<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('协供验收单')" />
    <style type="text/css">
        table{
            border-collapse: collapse;
            text-align: center;
        }
        tbody{
            border: 1px solid #000;
        }
        td,th{
            border: 1px solid #000;
        }
    </style>
</head>
<body>
<object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0" name="WebBrowser"> </object>

<div id="box" style="width: 978px;margin: 0px auto; position: relative;border:1px solid white;">
    <div id="box2" style="width: 978px;margin: 20px auto; border:1px solid white;">
        <div id="toPrintYanshou" style="width: 978px; position: relative; border:1px solid white;">
            <div id="bgImg" style="position: absolute; left: -40px; top: -40px;right: -40px;bottom: 20px;overflow:hidden;z-index: -1;">
                <div style="width: 1500px;height: auto;margin-right:-1500px;clear: both;">
                    <img src="../static/img/shuiyin.jpg" th:src="@{/img/shuiyin.jpg}" style="border: none;float: left;"/>
                    <img src="../static/img/shuiyin.jpg" th:src="@{/img/shuiyin.jpg}" style="border: none;float: left;"/>
                </div>
            </div>
            <h2 style="margin: 40px; font-size: 30px;text-align: center;">兰州市安宁区政府采购办公自动化协议供货验收单</h2>
            <div style="position:absolute;right: 10px;top: 0px;">
                <img src="../static/img/img111.png" th:src="@{/img/img111.png}" width="120" height="120" />
            </div>
            <span style="float: right;height: 40px; line-height: 50px; margin-right:10px;">单位：台、套、元</span>

            <table width="100%" border="0" id="tabc" cellspacing="0" cellpadding="0">
                <tr style="height: 50px;">
                    <td align="center" width="156" colspan="2" style=" border: 1px black solid;text-align: center;" >采购单位</td>
                    <td align="center" width="143" style="text-align: center;border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;  ">采购申报表编号</td>
                    <td align="center" width="78" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">审批预算（元）</td>
                    <td align="center" width="78" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">成交价格（元）</td>
                    <td align="center" width="69" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">联系人</td>
                    <td align="center" width="88" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">联系电话</td>
                    <td align="center" width="92" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">协议供货商</td>
                    <td align="center" width="55" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">供货商联系人</td>
                    <td align="center" width="88" style="text-align: center; border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">联系电话</td>
                    <td align="center" width="131" style="text-align: center;border-top: 1px solid black; border-bottom:1px solid black;border-right: 1px solid black;">供货合同编号</td>
                </tr>
                <tr style="height: 50px;">
                    <td align="center" width="156" colspan="2" style="text-align: center; border: 1px black solid;border-top:none;" th:text="${acceptanceContract.unitName}"></td>
                    <td align="center" width="143" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;"><span>安财采协</span><span th:text="${acceptanceContract.unitNumber}"></span></td>
                    <td align="center" width="78"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.expectMoney}"></td>
                    <td align="center" width="78"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.dealPrice}"></td>
                    <td align="center" width="69"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.unitManager}"></td>
                    <td align="center" width="88"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.unitTel}"></td>
                    <td align="center" width="92"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.supplierName}"></td>
                    <td align="center" width="55"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.manager}"></td>
                    <td align="center" width="88"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.supplierPhone}"></td>
                    <td align="center" width="131" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;"><span>安财采协</span><span th:text="${acceptanceContract.attribute7}"></span> </td>
                </tr>

                <tr style="height: 40px;">
                    <td align="center" width="47" style="text-align: center; border: 1px black solid;border-top:none;">序号</td>
                    <td align="center" width="109" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;">品  目</td>
                    <td align="center" colspan="5" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" width="456" >型号及参数</td>
                    <td align="center" width="92"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;">单  价</td>
                    <td align="center" width="55"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;">数  量</td>
                    <td align="center" width="88"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;">金  额</td>
                    <td align="center" width="131" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;">质量状况</td>
                </tr>

                <!--<c:if test="${beginNum!=null&&endNum!=null}">-->
                    <!--<c:forEach var="listDetails" items="${result}" varStatus="vs" begin="0" end="${changdu}">-->

                        <!--<tr style="height: 40px;" class="tn" th:each="listDetails,loopStatus :${result}">-->
                            <!--<td align="center" width="47" style=" border: 1px black solid;border-top:none;" th:text="${loopStatus.count}"></td>-->
                            <!--<td align="center" width="109" style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.items}"></td>-->
                            <!--<td align="center" colspan="5" width="456" style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.models}"></td>-->
                            <!--<td align="center" width="92"  style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.price}"></td>-->
                            <!--<td align="center" width="55"  style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.number}"></td>-->
                            <!--<td align="center" width="88"  style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.amount}"></td>-->
                            <!--<td align="center" width="131" style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.equality}"></td>-->
                        <!--</tr>-->

                    <!--</c:forEach>-->
                <!--</c:if>-->

                <!--<c:if test="${beginNum==null&&endNum==null}">-->
                    <!--<c:forEach var="listDetails" items="${acceptanceGoods}" varStatus="vs" >-->
                        <tr style="height: 40px;" class="tn" th:each="listDetails,loopStatus:${acceptanceGoods}">
                            <td align="center" width="47"  style="text-align: center; border: 1px black solid;border-top:none;" th:text="${loopStatus.count}"></td>
                            <td align="center" width="109" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.items}"></td>
                            <td align="center" colspan="5" width="456" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.models}"></td>
                            <td align="center" width="92"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.price}"></td>
                            <td align="center" width="55"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.number}"></td>
                            <td align="center" width="88"  style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.amount}"></td>
                            <td align="center" width="131" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" th:text="${listDetails.equality}"></td>
                        </tr>
                    <!--</c:forEach>-->
                <!--</c:if>-->


                <tr style="height: 40px;" id="btr">
                    <td align="center" colspan="2" style=" border: 1px black solid;border-top:none;">质量评分</td>
                    <!--<%&#45;&#45; <td align="center" colspan="9" style=" border-right:1px solid black;border-bottom: 1px solid black;" th:text="${acceptanceContract.acceptanceResult}"></td> &#45;&#45;%>-->
                    <td align="center" colspan="4" style="text-align: center;border: 1px black solid;border-top:none;" id="zhiliangpinfeng">
                        <span id="zhiliang1">☆</span>
                        <span id="zhiliang2">☆</span>
                        <span id="zhiliang3">☆</span>
                        <span id="zhiliang4">☆</span>
                        <span id="zhiliang5">☆</span>
                    </td>
                    <td align="center" colspan="2" style="text-align: center; border: 1px black solid;border-top:none;">服务评分</td>
                    <td align="center" colspan="3" style="text-align: center;border: 1px black solid;border-top:none;" id="taidupinfeng">
                        <span id="taidu1">☆</span>
                        <span id="taidu2">☆</span>
                        <span id="taidu3">☆</span>
                        <span id="taidu4">☆</span>
                        <span id="taidu5">☆</span>
                    </td>
                </tr>
                <tr style="height: 40px;">
                    <td align="center" colspan="2" style="text-align: center; border: 1px black solid;border-top:none;">评语</td>
                    <td align="left" colspan="9"  width="822" style="text-align: center; border-right:1px solid black;border-bottom: 1px solid black;" id="comment" value=""></td>
                </tr>

                <tr style="height: 100px;">
                    <td align="center" colspan="11" valign="bottom" style="text-align: center;border: 1px black solid;border-top:none;">
                        <span style="line-height:50px;padding-left: 80px;padding-right: 180px;">验收人：</span>
                        <span style="line-height: 50px; padding-right: 240px;">负责人：</span>
                        <span style="line-height: 50px;padding-right: 40px;">验收单位（章）：</span>
                        <span style="line-height: 50px;padding-right: 30px;">年</span>
                        <span style="line-height: 50px;padding-right: 30px;">月</span>
                        <span style="line-height: 50px;padding-right: 30px;">日</span>
                    </td>
                </tr>
            </table>
            <p style="margin-top: 10px;">备注：本合同一式四份，政府采购办、财政局业务科室、采购单位、供货方各一份。</p>
        </div>
        <div style=" margin: 0px auto;width: 978px;position: relative;" id="btnDiv">
            <!--<div class="numDiv" style="position: absolute;left: 20px; top: 2px;">-->
                <!--<form action="acceptanceYuLan.action" method="get" >-->
                    <input type="hidden" name="acceptanceContractId" id="acceptanceContractId" th:value="${acceptanceContract.acceptanceContractId}"/>
                    <!--<span>打印</span>-->
                    <!--<select id="selectBegin" name="beginNum">-->

                        <!--<c:forEach items="${acceptanceGoods}" varStatus="vs">-->
                            <!--<option value="${vs.index+1}">${vs.index+1}</option>-->
                        <!--</c:forEach>-->

                    <!--</select>-->
                    <!--<span>到</span>-->
                    <!--<select id="selectPage" name="endNum">-->
                        <!--<c:forEach items="${acceptanceGoods}" varStatus="vs">-->
                            <!--<option value="${vs.index+1}" <c:if test="${changdu ==(vs.index+1)}"> selected="selected" </c:if>>${vs.index+1}</option>-->
                        <!--</c:forEach>-->
                    <!--</select>-->
                    <!--<span>条</span>-->
                    <!--<input type="submit" id="previewBtn" value="预览"/>-->
                <!--</form>-->
            <!--</div>-->
            <input type="button" value="打印" onclick="fun_print(this)" style="display: block;width: 60px;float: right;margin-right: 40px;margin-top: 10px;font-size: 20px;" />
            <!--<input id="removeRow" style="display: none;width: 60px;float: right;margin-right: 40px;margin-top: 10px;font-size: 20px;" type="button" value="减行" onclick="jhtr()"/>-->
            <!--<input id="addRow" style="display: block;width: 60px;float: right;margin-right: 40px;margin-top: 10px;font-size: 20px;" type="button" value="增行" onclick="zjtr()"/>-->
            <!--<input id="addzpRow" style="display: block;width: 60px;float: right;margin-right: 40px;margin-top: 10px;font-size: 20px;color: red;" type="button" value="追评" onclick="zptr()"/>-->

        </div>
        <div style="clear:both;"></div>


        <div class="pageHeader" id="zhuping" style="display: none;">
            <input type="hidden" name="evaluateId" id="evaluateId" value="" />
            <div class="searchBar">
                <!-- <ul class="searchContent"> -->
                <dl>
                    <dt>追加评价：</dt>
                    <dd><textarea name="attribute1" id="attribute1" rows="7" cols="70" class="required stringCheck"></textarea></dd>
                    <dd><button type="submit" onclick="saved()">保存</button></dd>
                </dl>
                <!-- </ul> -->
            </div>
        </div>
    </div>

</div>
<th:block th:include="include :: footer" />

<script th:inline="javascript">

    $(document).ready(function(){
        var toposJson= [[${evaluate}]];
        console.log(toposJson)
        var qualityScore = toposJson[0].qualityScore;
        var serviceScore = toposJson[0].serviceScore;
        var evaluateId = toposJson[0].evaluateId;
        var comment = toposJson[0].comment;
        var attribute1 = toposJson[0].attribute1;
        $("#evaluateId").val(evaluateId);
        if(attribute1 == null || attribute1 == ""){
            $("#comment").append(comment);
        }else{
            var comments = comment+"</br>追加评价："+attribute1;
            $("#comment").append(comments);
            $("#addzpRow").hide();

        }

        for(var j=1;j<=5;j++){
            if(j<=qualityScore){
                document.getElementById("zhiliang"+j).innerHTML="★";
                document.getElementById("zhiliang"+j).setAttribute("style","color:red;font: 25px/25px '宋体'");
            }else{
                document.getElementById("zhiliang"+j).innerHTML="☆";
                document.getElementById("zhiliang"+j).setAttribute("style","color:red;font: 25px/25px '宋体'");
            }
            if(j<=serviceScore){
                document.getElementById("taidu"+j).innerHTML="★";
                document.getElementById("taidu"+j).setAttribute("style","color:red;font: 25px/25px '宋体'");
            }else{
                document.getElementById("taidu"+j).innerHTML="☆";
                document.getElementById("taidu"+j).setAttribute("style","color:red;font: 25px/25px '宋体'");
            }
        }
    });
    function fun_print(obj){
        //$("#btnDiv").remove();
        var ua = navigator.userAgent.toLowerCase();
        // 360兼容（IE）
        if(ua.indexOf("msie") > -1){
            $(obj).parent().remove();

            //wb.printing.leftMargin =10.00;
            //wb.printing.topMargin =10.00;
            //wb.printing.rightMargin =10.00;
            //wb.printing.bottomMargin =10.00;
            //SetPrintSettings();
            //WebBrowser.ExecWB(6,1);
            $("#box").jqprint();//(这个模式下打印添加行没有边框)
        }else{
            $(obj).parent().remove();
            $("#box").jqprint();
            //previewContract(obj);
            //$(obj).parent().remove();
            //window.print();(打印不了横向)
        }

    }

    function SetPrintSettings() {
        WebBrowser.printing.header = "";
        WebBrowser.printing.footer = "";
        WebBrowser.printing.portrait = false;//横印
        WebBrowser.printing.leftMargin = 1.0;
        WebBrowser.printing.topMargin = 1.3;
        WebBrowser.printing.rightMargin = 1.0;
        WebBrowser.printing.bottomMargin = 1.3;
    }
    function jhtr(){
        var tr = $("#btr").prev();
        if(tr.prev().find("td:eq(1)").text().replace(" ", "") != ""){
            $("#jhtr").hide();
        }
        if(tr.find("td:eq(1)").text().replace(" ", "") == ""){
            tr.remove();
        }
    }
    function zjtr(){
        var num = $(".tn").length + 1;
        var tr = '<tr style="height: 40px;" class="tn">' +
                '<td align="center" width="47" style=" border: 1px solid black;border-top:none;">' + num +
                '</td>' +
                '<td align="center" width="109" style=" border-right:1px solid black;border-bottom: 1px solid black;"><span> </span></td>' +
                '<td align="center" colspan="5" width="456" style=" border-right:1px solid black;border-bottom: 1px solid black;"><span> </span></td>' +
                '<td align="center" width="92"  style=" border-right:1px solid black;border-bottom: 1px solid black;"><span> </span></td>' +
                '<td align="center" width="55"  style=" border-right:1px solid black;border-bottom: 1px solid black;"><span> </span></td>' +
                '<td align="center" width="88"  style=" border-right:1px solid black;border-bottom: 1px solid black;"><span> </span></td>' +
                '<td align="center" width="131" style=" border-right:1px solid black;border-bottom: 1px solid black;"><span> </span></td></tr>';
        $("#btr").before(tr);
        $("#removeRow").show();
    }
    function zptr(){
        $("#zhuping").show();
    }
    function saved() {
        debugger;
        var attribute1 = $("#attribute1").val();
        var evaluateId = $("#evaluateId").val();
        var acceptanceContractId = $("#acceptanceContractId").val();
        $.ajax({
            type: "Post",
            scriptCharset: "utf-8",
            contentType: "application/json;chartset=utf-8",
            dataType: "json",
            url: "saveEvaluate.action?attribute1="+attribute1+"&evaluateId="+evaluateId+"&acceptanceContractId="+acceptanceContractId,
            success: function (data) {
                var attribute1 = data[0].attribute1;
                var comment = data[0].comment;
                var comments = "</br>追加评价："+attribute1;
                $("#comment").append("");
                $("#zhuping").hide();
                $("#comment").append(comments);
                $("#addzpRow").hide();
            }
        });
    }
    function printPage(obj){
        $(obj).remove();
        var ua = navigator.userAgent.toLowerCase();
        window.print();
        /*if(ua.indexOf("msie") > -1){
         window.print();
         }else{
         $("#box").jqprint();
         }*/
    }
</script>
</body>
</html>